import { ReactNode } from 'react';

import cn from 'classnames';

import cs from './Block.module.scss';

export const Block = ({
  title,
  titleComponent,
  body,
  isBigTitle = false,
  isBigGap = false,
}: {
  title?: ReactNode;
  titleComponent?: ReactNode;
  body?: ReactNode;
  isBigGap?: boolean;
  isBigTitle?: boolean;
}) => (
  <div className={cn(cs.block, { [cs.isBigGap]: isBigGap })}>
    {titleComponent || <h3 className={isBigTitle ? cs.titleBig : cs.title}>{title}</h3>}
    {body}
  </div>
);
